<?php

//No direct access

defined('_JEXEC') or die('Restricted access');

?>

<div id="ownservices">


 <div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>


	<div id="mainownservice">

	<h3><?php echo JText::_('OWNSERVICE_USER_DETAIL'); ?></h3>

	<hr />

	<?php

		$dateformat  = OwnserviceHelper::getParams('date_format', '%d/%m/%Y');

		$row = $this->row;

	?>

	<form action="<?php echo JRoute::_('index.php?option=com_ownservice'); ?>" method="post" name="adminForm">

	<table width="100%">
		<tr>
			<td valign="top">
				<table class="admintable">

					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_DATE'); ?></td>
			
						<td><?php echo JHTML::_('date', $row->created, $dateformat); ?></td>
			
					</tr>
					
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_ACCESS_LEVEL'); ?></td>
			
						<td><?php echo $row->groupname; ?></td>
			
					</tr>
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_BRANCH'); ?></td>
			
						<td><?php echo $row->branchname; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_FIRSTNAME'); ?></td>
			
						<td><?php echo $row->firstname; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_LASTNAME'); ?></td>
			
						<td><?php echo $row->lastname; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_USERNAME'); ?></td>
			
						<td><?php echo $row->username; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_ADDRESS'); ?></td>
			
						<td><?php echo $row->address; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_CITY'); ?></td>
			
						<td><?php echo $row->city; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_STATE'); ?></td>
			
						<td><?php echo $row->state; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_POSTCODE'); ?></td>
			
						<td><?php echo $row->postcode; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_COUNTRY'); ?></td>
			
						<td><?php echo $row->country; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_PHONE'); ?></td>
			
						<td><?php echo $row->phone; ?></td>
			
					</tr>
			
					<tr>
			
						<td class="key"><?php echo JText::_('OWNSERVICE_EMAIL'); ?></td>
			
						<td><?php echo $row->email; ?></td>
			
					</tr>
				</table>
			</td>
			<td valign="top" align="right">
				<table class="admintable">
					<tr>
						<td class="key" align="right"><?php echo JText::_('Photo'); ?> :</td>
						<td align="right">
							<?php 
							if(count($this->files) > 0) {
								foreach($this->files as $file) {
							?>
							<div style="margin-right: 5px;">
							<?php
									if(OwnserviceHelper::isImage($file->filename)):
							?>
										<a class="img-preview" href="<?php echo JURI::root(true).'/'.OwnserviceHelper::getParams('path', 'images/stories/ownservices').'/'.$row->user_id.'/'.$file->filename ?>"><img src="<?php echo JURI::root(true).'/'.OwnserviceHelper::getParams('path', 'images/stories/ownservices').'/'.$row->user_id.'/'.$file->filename ?>" style="border: 1px solid silver;" width="<?php echo $file->width; ?>" height="<?php echo $file->height; ?>" /></a>
							<?php 
									else:
										$icon = '';
										$icon	= JHTML::image(OwnserviceHelper::addIcon( $file ), $file->ext, 'class="icon-mime"') .'&nbsp;';
							?>
										<?php echo $icon ?><a href="index.php?option=com_ownservice&controller=user&task=download&id=<?php echo $file->id; ?>"><?php echo $file->filename; ?></a>
							<?php
									endif;
							?>
							</div>
							<?php
								}
							}
							?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			
			<td colspan="2"><hr /></td>

		</tr>

		<tr>

			<td colspan="2" align="center">

			<input type="button" name="cancel" value="<?php echo JText::_('OWNSERVICE_BACK'); ?>" onClick="javascript:document.location.href='<?php echo JText::_('index.php?option=com_ownservice&view=users'); ?>';" />

			<?php if($this->access->canEdit || $this->access->canEditOwn):?><input type="submit" name="edit" value="<?php echo JText::_('OWNSERVICE_EDIT'); ?>" /><?php endif; ?>

			</td>

		</tr>
	</table>

	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />

	<input type="hidden" name="option" value="com_ownservice" />

	<input type="hidden" name="task" value="edit" />

	<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />

	<input type="hidden" name="controller" value="user" />

	<input type="hidden" name="view" value="user" />

	<?php echo JHTML::_( 'form.token' ); ?>

	</form>

	</div>

</div>

